package com.auth.config.response;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * 自定义异常信息类
 * @author: hw
 * @date: 2020/12/23 20:35
 */
@JsonSerialize(using = CustomOauthExceptionSerializer.class)
public class CustomOauthException extends OAuth2Exception {

    @Getter
    @Setter
    private String errorCode;

    public CustomOauthException(String msg, Throwable t) {
        super(msg, t);
        this.errorCode = msg;
    }

    public CustomOauthException(String msg) {
        super(msg);
    }

    public CustomOauthException(String message, String error) {
        super(message);
        this.errorCode = error;
    }
}
